﻿using UnityEngine;

public class CameraFollow : MonoBehaviour
{
    public Transform Target;
    public float Z, FollowSmooth;

    private void Update()
    {
        transform.position = Vector3.Lerp(transform.position, new Vector3(Target.position.x, Target.position.y, Z), FollowSmooth);
    }

    public void OnChangeTarget(Transform newTarget)
    {
        Target = newTarget;
    }
}
